﻿@model List<TruckWatch.Cloud.Models.EF.Location>
@{
    ViewBag.Title = "Locations";
}
<fieldset>

    <div>
        @(Html.Telerik().Grid(Model).Name("Locations")
    .Columns(columns =>
    {
        columns.Bound(c => c.LocationName).Width(250);
        columns.Bound(c => c.AddressLine1).Width(250);
        columns.Bound(c => c.City).Width(150);
        columns.Bound(c => c.State).Width(75);
        columns.Bound(c => c.ZipCode).Width(100);
        columns.Bound(c => c.Latitude).Width(100);
        columns.Bound(c => c.Longitude).Width(100);
        columns.Command(s =>
        {
            s.Edit();
            s.Delete();
        }).Width(220);
    })
    .ToolBar(commands => commands.Insert())
    .DataKeys(k => k.Add(o => o.Id))
    .Pageable()
    .Sortable()
    .DataBinding(b =>
    {
        b.Server().Update("UpdateLocation", "Location");
        b.Server().Insert("AddLocation", "Location");
        b.Server().Delete("DeleteLocation", "Location");
    })
    .HtmlAttributes(new { style = "width:1245px" })
 )
    </div>
</fieldset>
<br />
